HomeController = {
    homeModel : null,

	init : function(data) {
		this.view = HomeView;
		this.model = data;			
        this.model = new ListHotBook();
	    this.homeModel = HomeModel;	    
        this.callServiceHotBook();
	},

    callServiceHotBook: function(){
        var self = this;
        ajax.get({
	        url: "http://localhost:8080/book-service/public/book/store/hotbook",
	
	        success: function(data, xhr){
	           self.isFinishHotBook = true;
	           self.model.HotBooks = self.homeModel.createHotBooks(data);
	           self.updateData();
	        },
	
	        failure: function(xhr){
	            console.log("fail callServiceHotBook");
	        }
        });
    },

    updateData: function(){
        if(this.isFinishHotBook){
            this.view.updateView();
        }
    }

};
